﻿using Infrastructure.Model.DI;
using Microsoft.Extensions.Logging;
using Model.EntityModel.Auth;
using Model.EntityModel.SysModel;
using Repository.IRepository.ISysRepository;
using Service.IService.ISysService;

namespace Service.Service.SysService
{
    /// <summary>
    /// 部门服务实现
    /// </summary>
    [AppService(ServiceType = typeof(IDeptService), ServiceLifetime = LifeTime.Scoped)]
    public class DeptService : IDeptService
    {
        private readonly IDeptRepository _deptRepo;
        private readonly ILogger<DeptService> _logger;

        public DeptService(
            IDeptRepository deptRepo,
            ILogger<DeptService> logger)
        {
            _deptRepo = deptRepo;
            _logger = logger;
        }

        public async Task<string> CreateDeptAsync(Dept dept)
        {
            return await _deptRepo.CreateDeptAsync(dept);
        }

        public List<Dept> GetDeptTree()
        {
            return _deptRepo.GetDeptTree();
        }

     

        public async Task<List<Dept>> GetDeptHierarchyAsync()
        {
            return await _deptRepo.GetDeptHierarchyAsync();
        }

        public bool CreateDept(Dept dept)
        {
            return _deptRepo.CreateDept(dept);
        }

        public bool UpdateDept(Dept dept)
        {
            return _deptRepo.UpdateDept(dept);
        }

        public bool DeptExists(string deptId)
        {
            return _deptRepo.DeptExists(deptId);
        }

        public Dept GetDeptById(string deptId)
        {
            return _deptRepo.GetDeptById(deptId);
        }

        public bool DeleteDept(string deptId)
        {
            return _deptRepo.DeleteDept(deptId);
        }

        public List<Dept> GetAllDepts()
        {
            return _deptRepo.GetAllDepts();
        }

        public Task<bool> UpdateDeptAsync(Dept dept)
        {
            throw new NotImplementedException();
        }

        public Task<bool> DeleteDeptAsync(string id)
        {
            throw new NotImplementedException();
        }

        public Task<Dept> GetDeptByIdAsync(string id)
        {
            throw new NotImplementedException();
        }

        public Task<List<Dept>> GetAllDeptsAsync()
        {
            throw new NotImplementedException();
        }

        public Task<bool> IsDeptExistsAsync(string deptId)
        {
            throw new NotImplementedException();
        }
    }
}
